using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using OpenTK.Math;
using System.Drawing;

namespace Dogfight2008.Common.Tests
{
  [TestFixture]
  public class ColoredPolygonFixture
  {
    static List<Vector3> CreateVertices()
    {
      List<Vector3> vertices = new List<Vector3>();
      vertices.Add(v(0, 0, 0));
      vertices.Add(v(1, 0, 0));
      vertices.Add(v(1, 1, 0));
      return vertices;
    }

    [Test]
    public void Construct()
    {
      List<Vector3> vertices = CreateVertices();
      Color color = Color.AliceBlue;
      ColoredPolygon cpol = new ColoredPolygon(color, vertices);
    }

    [Test]
    public void AccessColor()
    {
      List<Vector3> vertices = CreateVertices();
      Color color = Color.AliceBlue;
      ColoredPolygon cpol = new ColoredPolygon(color, vertices);
      Assert.AreEqual(Color.AliceBlue, cpol.Color);
    }

    static Vector3 v(double x, double y, double z)
    {
      return new Vector3((float)x, (float)y, (float)z);
    }

    [Test]
    public void AccessVertices()
    {
      FixedList<Vector3> vertices = new FixedList<Vector3>(CreateVertices());
      ColoredPolygon cpol = new ColoredPolygon(Color.AntiqueWhite, vertices);
      FixedList<Vector3> verts2 = new FixedList<Vector3>(CreateVertices());
      Assert.AreEqual(verts2, cpol.Vertices);
    }
  }
}
